Platform Explorer / Nuxeo Platform 2021.49

Component org.nuxeo.ecm.platform.audit.web

Documentation

NXAudit action contributions.

@version 1.0

Anguenot

Resolution Order

281
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Contributions

XML Source

<?xml version="1.0" encoding="UTF-8"?>
<component name="org.nuxeo.ecm.platform.audit.web">

  <documentation>
    NXAudit action contributions.

    @version 1.0
    @author Julien
    Anguenot
  </documentation>

  <extension target="org.nuxeo.ecm.platform.actions.ActionService"
    point="actions">
    <documentation>
      Contribute a new action related to document history.
    </documentation>

    <action id="TAB_CONTENT_HISTORY" link="/incl/tabs/document_history.xhtml"
      enabled="true" label="action.view.history" icon="/icons/file.gif" order="100"
      type="rest_document_link">
      <category>VIEW_ACTION_LIST</category>
      <filter-id>TAB_CONTENT_HISTORY_has_subtabs</filter-id>
    </action>

    <action id="TAB_EVENTS" link="/incl/tabs/document_events_cv.xhtml"
      enabled="true" label="action.view.events" icon="/icons/file.gif" order="50"
      type="rest_document_link">
      <category>TAB_CONTENT_HISTORY_sub_tab</category>
      <filter-id>view_content_history</filter-id>
    </action>

    <action id="TAB_EVENTS_PROXY" link="/incl/tabs/document_events_cv.xhtml"
      enabled="true" label="action.view.events" icon="/icons/file.gif" order="50"
      type="rest_document_link">
      <category>TAB_CONTENT_HISTORY_sub_tab</category>
      <filter-id>view_proxy_history</filter-id>
      <filter-id>only_for_manager</filter-id>
    </action>

    <action id="TAB_VERSIONS" link="/incl/tabs/document_versions.xhtml"
      enabled="true" label="action.view.versions" icon="/icons/file.gif" order="100"
      type="rest_document_link">
      <category>TAB_CONTENT_HISTORY_sub_tab</category>
      <filter-id>versionable</filter-id>
    </action>

    <!-- Version actions -->
    <action id="VIEW_VERSION" link="#{versionedActions.viewArchivedVersion}"
      label="command.viewArchivedVersion" order="10">
      <category>VERSION_LIST_ITEM</category>
    </action>

    <action id="RESTORE_VERSION" link="#{versionedActions.restoreToVersion}"
      label="command.restore" order="20">
      <category>VERSION_LIST_ITEM</category>
      <filter-id>canRestoreVersion</filter-id>
      <filter-id>canRestoreMainBlob</filter-id>
    </action>

    <action id="CURRENT_VERSION_SELECTION_DELETE" link="#{versionedActions.removeSelectedArchivedVersions}"
      label="command.removeSelectedArchivedVersions" confirm="if( !confirmDeleteDocuments() ) return false;"
      order="10">
      <category>CURRENT_VERSION_SELECTION_LIST</category>
      <filter-id>canDeleteCurrentVersionSelection</filter-id>
    </action>

  </extension>

  <extension target="org.nuxeo.ecm.platform.actions.ActionService"
    point="filters">

    <filter id="view_content_history">
      <rule grant="false">
        <type>WorkspaceRoot</type>
        <type>SectionRoot</type>
        <type>Server</type>
      </rule>
      <rule grant="false">
        <facet>Immutable</facet>
      </rule>
    </filter>

    <filter id="view_proxy_history">
      <rule grant="true">
        <condition>document != null &amp;&amp; document.isProxy()</condition>
      </rule>
    </filter>

    <filter id="TAB_CONTENT_HISTORY_has_subtabs">
      <rule grant="false">
        <condition>
          #{webActions.getActionsList('TAB_CONTENT_HISTORY_sub_tab').isEmpty()}
        </condition>
      </rule>
    </filter>

    <filter id="versionable">
      <rule grant="true">
        <facet>Versionable</facet>
      </rule>
      <rule grant="false">
        <facet>Immutable</facet>
      </rule>
    </filter>

    <filter id="canDeleteCurrentVersionSelection">
      <rule grant="true">
        <condition>#{versionedActions.canRemoveSelectedArchivedVersions}
        </condition>
      </rule>
    </filter>

    <filter id="canRestoreVersion">
      <rule grant="true">
        <condition>#{versionedActions.canRestore}
        </condition>
      </rule>
    </filter>

    <filter id="canRestoreMainBlob">
      <rule grant="false">
        <type>File</type>
        <condition>#{blobHolderGenerator.getBlobHolder(document).blob.length lt 0}</condition>
      </rule>
    </filter>

  </extension>

</component>